﻿using System;
using Misuzilla.Net.Irc;

namespace Misuzilla.Crigate.Authenticate
{
    public class SimpleAuthorizer : IAuthorizer
    {
        #region IAuthorizer メンバ

        public AuthenticateResult Authenticate(Session session, UserInfo userInfo)
        {
            if (String.IsNullOrEmpty(userInfo.Nick))
            {
                return new AuthenticateResult(ErrorReply.ERR_NONICKNAMEGIVEN, "No nickname given");
            }

            if (String.IsNullOrEmpty(userInfo.Password))
            {
                return new AuthenticateResult(ErrorReply.ERR_PASSWDMISMATCH, "Password Incorrect");
            }

            return new AuthenticateResult();
        }

        #endregion
    }
}
